package com.example.makerspace.dao;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.makerspace.domain.ExamDO;
import com.example.makerspace.mapper.ExamMapper;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
public class ExamDAO extends BaseDAO<ExamDO>{
    @Resource
    private ExamMapper examMapper;

    public final static String EXAM_NAME = "exam_name";

    @PostConstruct
    public void init(){
        this.mapper = examMapper;
    }

    public ExamDO selectByExamName(String examName){
        return examMapper.selectOne(new QueryWrapper<ExamDO>().eq(EXAM_NAME, examName));
    }
}
